/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.sanerzone.smscenter.modules.sms.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sanerzone.jeebase.common.persistence.DataEntity;
import com.sanerzone.jeebase.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.util.Date;
/**
 * 网关信息Entity
 * @author xql
 * @version 2018-04-24
 */
public class SmsGateway extends DataEntity<SmsGateway> {

	private static final long serialVersionUID = 1L;
	private String gwCode;		// 网关编号
	private String appCode;		// 应用编号
	private String gwName;		// 网关名称
	private String gwRemark;		// 备注
	private Integer gwStatus;		// 网关状态(0停止1运行中2禁用)
	private String gwType;		// 网关类型(全网:QW, 移动:YD, 联通:LT, 电信:DX)
	private String gwProto;		// 网关协议(CMPP,SMGP,SGIP,HTTP)
	private String gwProtoVersion;		// 协议版本(30,20)
	private String gwProtoClass;		// 协议实现类
	private String gwProtoExtparam;		// 协议扩展参数
	private String gwServerIp;		// 服务器IP
	private String gwServerPort;		// 服务器端口
	private String gwLocalIp;		// 本地IP
	private String gwLocalPort;		// 本地端口
	private String gwUsername;		// 网关用户名
	private String gwPassword;		// 网关密码
	private String gwSpNumber;		// 网关接入号
	private String gwCorpId;		// 网关企业代码
	private String gwServiceId;		// 网关服务代码
	private String gwReceiveModel;		// 状态报告获取模式(0被动1主动)
	private Integer smsSignModel;		// 短信签名模式(0自定义、1强制签名)
	private Integer smsSignNose;		// 短信签名端（0本地、1网关）
	private Integer gwLongsms;		// 是否支持长短信(0支持1不支持)
	private Integer gwOnceSubmit;		// 一次提交数量
	private Double gwSendRate;		// 发送速率
	private Integer gwReceiveRate;		// 接收速率
	private Integer gwConnections;		// 网关连接数
	private String gwDeliverStatus;		// 线程获取上行状态1，启动线程,；0，关闭线程
	private Date createTime;		// 创建时间
	private Date modifyTime;		// 更新时间
	private User modifyBy;		// 更新人
	private String modifyRemark;		// 更新备注
	private String sendArea;		// 发送区域限制
	private String accountArea;		// 开户地区
	private String accountCarrier;		// 开户运营商
	private String accountCarrierContact;		// 开户运营商联系人
	private Integer maxWordNum;		// 单条最大发送字数
	private Integer useGateway;		// 超过单条字数不使用网关
	private Integer billLength;		// 长短信每条计费长度
	private String needSign;		// 是否需要签名
	private String sginCotent;		// 签名内容
	private String gwSendContent;		// 网关发送类型
	private Integer daySendLimit;		// 日发送量限制
	private Integer sendSpeedLimit;		// 发送速度限制
	private Integer maxWordNumber;		// 用户最少发送条数
	private String supportStateReport;		// 是否支持状态报告
	private Integer priority;		// 优先级
	private String loginid;		// 登录ID
	private String interfaceImplclass;		// 接口实现类
	private String sendAddress;		// 发送地址
	private String balanceAddress;		// 余额地址
	private String stateReportAddress;		// 状态报告地址
	private String receiveAddress;		// 接收地址
	private String stateGetmethod;		// 状态获取方式（接收、获取）
	private String supportReply;		// 是否支持上行
	private Integer replyInterval;		// 上行取间隔时间
	private String startStatereportThread;		// 是否启动状态报告取线程
	private Integer statereportInterval;		// 状态报告取间隔时间
	private String statereportUpdateMethod;		// 状态报告更新方式
	private Integer maxNumber;		// 一次提交的最大条数
	private Integer minNumber;		// 一次提交的最少条数
	private Integer massFlag;
	private Integer submitInterval;		// 每条短信提交后休息多久
	private String interfaceDoc;		// 接口文档
	private Integer balance;		// 余额
	private Integer speed;		// 速度
	private String business;		// 商务
	private Integer dosage;		// 用量
	private float price;		// 价格
	private String directConnect;		// 直连
	private String readTimeout; 		//物理连接读操作超时时间(单位：秒)
	private String reconnectInterval; 	//连接中断时重连间隔时间(单位：秒)
	private String transactionTimeout; 	//操作超时时间(单位：秒)
	private String heartbeatInterval;	//心跳信息发送间隔时间(单位：秒)
	private String heartbeatNoresponseout;	//需要重连时，连续发出心跳而没有接收到响应的个数（单位：个)

	public Integer getMassFlag() {
		return massFlag;
	}

	public void setMassFlag(Integer massFlag) {
		this.massFlag = massFlag;
	}

	public SmsGateway() {
		super();
	}

	public SmsGateway(String id){
		super(id);
	}

	@Length(min=1, max=10, message="网关编号长度必须介于 1 和 10 之间")
	public String getGwCode() {
		return gwCode;
	}

	public void setGwCode(String gwCode) {
		this.gwCode = gwCode;
	}

	@Length(min=1, max=45, message="应用编号长度必须介于 1 和 45 之间")
	public String getAppCode() {
		return appCode;
	}

	public void setAppCode(String appCode) {
		this.appCode = appCode;
	}

	@Length(min=1, max=80, message="网关名称长度必须介于 1 和 80 之间")
	public String getGwName() {
		return gwName;
	}

	public void setGwName(String gwName) {
		this.gwName = gwName;
	}

	@Length(min=0, max=255, message="备注长度必须介于 0 和 255 之间")
	public String getGwRemark() {
		return gwRemark;
	}

	public void setGwRemark(String gwRemark) {
		this.gwRemark = gwRemark;
	}

	public Integer getGwStatus() {
		return gwStatus;
	}

	public void setGwStatus(Integer gwStatus) {
		this.gwStatus = gwStatus;
	}

	@Length(min=1, max=2, message="网关类型(全网:QW, 移动:YD, 联通:LT, 电信:DX)长度必须介于 1 和 2 之间")
	public String getGwType() {
		return gwType;
	}

	public void setGwType(String gwType) {
		this.gwType = gwType;
	}

	@Length(min=1, max=10, message="网关协议(CMPP,SMGP,SGIP,HTTP)长度必须介于 1 和 10 之间")
	public String getGwProto() {
		return gwProto;
	}

	public void setGwProto(String gwProto) {
		this.gwProto = gwProto;
	}

	@Length(min=1, max=45, message="协议版本(30,20)长度必须介于 1 和 45 之间")
	public String getGwProtoVersion() {
		return gwProtoVersion;
	}

	public void setGwProtoVersion(String gwProtoVersion) {
		this.gwProtoVersion = gwProtoVersion;
	}

	@Length(min=0, max=100, message="协议实现类长度必须介于 0 和 100 之间")
	public String getGwProtoClass() {
		return gwProtoClass;
	}

	public void setGwProtoClass(String gwProtoClass) {
		this.gwProtoClass = gwProtoClass;
	}

	@Length(min=0, max=800, message="协议扩展参数长度必须介于 0 和 800 之间")
	public String getGwProtoExtparam() {
		return gwProtoExtparam;
	}

	public void setGwProtoExtparam(String gwProtoExtparam) {
		this.gwProtoExtparam = gwProtoExtparam;
	}

	public String getGwServerIp() {
		return gwServerIp;
	}

	public void setGwServerIp(String gwServerIp) {
		this.gwServerIp = gwServerIp;
	}

	public String getGwServerPort() {
		return gwServerPort;
	}

	public void setGwServerPort(String gwServerPort) {
		this.gwServerPort = gwServerPort;
	}

	public String getGwLocalIp() {
		return gwLocalIp;
	}

	public void setGwLocalIp(String gwLocalIp) {
		this.gwLocalIp = gwLocalIp;
	}

	public String getGwLocalPort() {
		return gwLocalPort;
	}

	public void setGwLocalPort(String gwLocalPort) {
		this.gwLocalPort = gwLocalPort;
	}

	@Length(min=0, max=64, message="网关用户名长度必须介于 0 和 64 之间")
	public String getGwUsername() {
		return gwUsername;
	}

	public void setGwUsername(String gwUsername) {
		this.gwUsername = gwUsername;
	}

	@Length(min=0, max=64, message="网关密码长度必须介于 0 和 64 之间")
	public String getGwPassword() {
		return gwPassword;
	}

	public void setGwPassword(String gwPassword) {
		this.gwPassword = gwPassword;
	}

	public String getGwSpNumber() {
		return gwSpNumber;
	}

	public void setGwSpNumber(String gwSpNumber) {
		this.gwSpNumber = gwSpNumber;
	}

	public String getGwCorpId() {
		return gwCorpId;
	}

	public void setGwCorpId(String gwCorpId) {
		this.gwCorpId = gwCorpId;
	}

	public String getGwServiceId() {
		return gwServiceId;
	}

	public void setGwServiceId(String gwServiceId) {
		this.gwServiceId = gwServiceId;
	}

	@NotNull(message="状态报告获取模式(0被动1主动)不能为空")
	public String getGwReceiveModel() {
		return gwReceiveModel;
	}

	public void setGwReceiveModel(String gwReceiveModel) {
		this.gwReceiveModel = gwReceiveModel;
	}

	@NotNull(message="短信签名模式(0自定义、1强制签名)不能为空")
	public Integer getSmsSignModel() {
		return smsSignModel;
	}

	public void setSmsSignModel(Integer smsSignModel) {
		this.smsSignModel = smsSignModel;
	}

	@NotNull(message="短信签名端（0本地、1网关）不能为空")
	public Integer getSmsSignNose() {
		return smsSignNose;
	}

	public void setSmsSignNose(Integer smsSignNose) {
		this.smsSignNose = smsSignNose;
	}

	public Integer getGwLongsms() {
		return gwLongsms;
	}

	public void setGwLongsms(Integer gwLongsms) {
		this.gwLongsms = gwLongsms;
	}

	public Integer getGwOnceSubmit() {
		return gwOnceSubmit;
	}

	public void setGwOnceSubmit(Integer gwOnceSubmit) {
		this.gwOnceSubmit = gwOnceSubmit;
	}

	public Double getGwSendRate() {
		return gwSendRate;
	}

	public void setGwSendRate(Double gwSendRate) {
		this.gwSendRate = gwSendRate;
	}

	public Integer getGwReceiveRate() {
		return gwReceiveRate;
	}

	public void setGwReceiveRate(Integer gwReceiveRate) {
		this.gwReceiveRate = gwReceiveRate;
	}

	public Integer getGwConnections() {
		return gwConnections;
	}

	public void setGwConnections(Integer gwConnections) {
		this.gwConnections = gwConnections;
	}

	public String getGwDeliverStatus() {
		return gwDeliverStatus;
	}

	public void setGwDeliverStatus(String gwDeliverStatus) {
		this.gwDeliverStatus = gwDeliverStatus;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public User getModifyBy() {
		return modifyBy;
	}

	public void setModifyBy(User modifyBy) {
		this.modifyBy = modifyBy;
	}

	@Length(min=0, max=255, message="更新备注长度必须介于 0 和 255 之间")
	public String getModifyRemark() {
		return modifyRemark;
	}

	public void setModifyRemark(String modifyRemark) {
		this.modifyRemark = modifyRemark;
	}

	@Length(min=0, max=32, message="发送区域限制长度必须介于 0 和 32 之间")
	public String getSendArea() {
		return sendArea;
	}

	public void setSendArea(String sendArea) {
		this.sendArea = sendArea;
	}

	@Length(min=0, max=32, message="开户地区长度必须介于 0 和 32 之间")
	public String getAccountArea() {
		return accountArea;
	}

	public void setAccountArea(String accountArea) {
		this.accountArea = accountArea;
	}

	@Length(min=0, max=32, message="开户运营商长度必须介于 0 和 32 之间")
	public String getAccountCarrier() {
		return accountCarrier;
	}

	public void setAccountCarrier(String accountCarrier) {
		this.accountCarrier = accountCarrier;
	}

	@Length(min=0, max=32, message="开户运营商联系人长度必须介于 0 和 32 之间")
	public String getAccountCarrierContact() {
		return accountCarrierContact;
	}

	public void setAccountCarrierContact(String accountCarrierContact) {
		this.accountCarrierContact = accountCarrierContact;
	}

	public Integer getMaxWordNum() {
		return maxWordNum;
	}

	public void setMaxWordNum(Integer maxWordNum) {
		this.maxWordNum = maxWordNum;
	}

	public Integer getUseGateway() {
		return useGateway;
	}

	public void setUseGateway(Integer useGateway) {
		this.useGateway = useGateway;
	}

	public Integer getBillLength() {
		return billLength;
	}

	public void setBillLength(Integer billLength) {
		this.billLength = billLength;
	}

	@Length(min=0, max=32, message="是否需要签名长度必须介于 0 和 32 之间")
	public String getNeedSign() {
		return needSign;
	}

	public void setNeedSign(String needSign) {
		this.needSign = needSign;
	}

	@Length(min=0, max=32, message="签名内容长度必须介于 0 和 32 之间")
	public String getSginCotent() {
		return sginCotent;
	}

	public void setSginCotent(String sginCotent) {
		this.sginCotent = sginCotent;
	}

	@Length(min=0, max=32, message="网关发送类型长度必须介于 0 和 32 之间")
	public String getGwSendContent() {
		return gwSendContent;
	}

	public void setGwSendContent(String gwSendContent) {
		this.gwSendContent = gwSendContent;
	}

	public Integer getDaySendLimit() {
		return daySendLimit;
	}

	public void setDaySendLimit(Integer daySendLimit) {
		this.daySendLimit = daySendLimit;
	}

	public Integer getSendSpeedLimit() {
		return sendSpeedLimit;
	}

	public void setSendSpeedLimit(Integer sendSpeedLimit) {
		this.sendSpeedLimit = sendSpeedLimit;
	}

	public Integer getMaxWordNumber() {
		return maxWordNumber;
	}

	public void setMaxWordNumber(Integer maxWordNumber) {
		this.maxWordNumber = maxWordNumber;
	}

	@Length(min=0, max=2, message="是否支持状态报告长度必须介于 0 和 2 之间")
	public String getSupportStateReport() {
		return supportStateReport;
	}

	public void setSupportStateReport(String supportStateReport) {
		this.supportStateReport = supportStateReport;
	}

	public Integer getPriority() {
		return priority;
	}

	public void setPriority(Integer priority) {
		this.priority = priority;
	}

	@Length(min=0, max=32, message="登录ID长度必须介于 0 和 32 之间")
	public String getLoginid() {
		return loginid;
	}

	public void setLoginid(String loginid) {
		this.loginid = loginid;
	}

	@Length(min=0, max=32, message="接口实现类长度必须介于 0 和 32 之间")
	public String getInterfaceImplclass() {
		return interfaceImplclass;
	}

	public void setInterfaceImplclass(String interfaceImplclass) {
		this.interfaceImplclass = interfaceImplclass;
	}

	@Length(min=0, max=32, message="发送地址长度必须介于 0 和 32 之间")
	public String getSendAddress() {
		return sendAddress;
	}

	public void setSendAddress(String sendAddress) {
		this.sendAddress = sendAddress;
	}

	@Length(min=0, max=32, message="余额地址长度必须介于 0 和 32 之间")
	public String getBalanceAddress() {
		return balanceAddress;
	}

	public void setBalanceAddress(String balanceAddress) {
		this.balanceAddress = balanceAddress;
	}

	@Length(min=0, max=32, message="状态报告地址长度必须介于 0 和 32 之间")
	public String getStateReportAddress() {
		return stateReportAddress;
	}

	public void setStateReportAddress(String stateReportAddress) {
		this.stateReportAddress = stateReportAddress;
	}

	@Length(min=0, max=32, message="接收地址长度必须介于 0 和 32 之间")
	public String getReceiveAddress() {
		return receiveAddress;
	}

	public void setReceiveAddress(String receiveAddress) {
		this.receiveAddress = receiveAddress;
	}

	@Length(min=0, max=32, message="状态获取方式（接收、获取）长度必须介于 0 和 32 之间")
	public String getStateGetmethod() {
		return stateGetmethod;
	}

	public void setStateGetmethod(String stateGetmethod) {
		this.stateGetmethod = stateGetmethod;
	}

	@Length(min=0, max=2, message="是否支持上行长度必须介于 0 和 2 之间")
	public String getSupportReply() {
		return supportReply;
	}

	public void setSupportReply(String supportReply) {
		this.supportReply = supportReply;
	}

	public Integer getReplyInterval() {
		return replyInterval;
	}

	public void setReplyInterval(Integer replyInterval) {
		this.replyInterval = replyInterval;
	}

	@Length(min=0, max=32, message="是否启动状态报告取线程长度必须介于 0 和 32 之间")
	public String getStartStatereportThread() {
		return startStatereportThread;
	}

	public void setStartStatereportThread(String startStatereportThread) {
		this.startStatereportThread = startStatereportThread;
	}

	public Integer getStatereportInterval() {
		return statereportInterval;
	}

	public void setStatereportInterval(Integer statereportInterval) {
		this.statereportInterval = statereportInterval;
	}

	public String getStatereportUpdateMethod() {
		return statereportUpdateMethod;
	}

	public void setStatereportUpdateMethod(String statereportUpdateMethod) {
		this.statereportUpdateMethod = statereportUpdateMethod;
	}

	public Integer getMaxNumber() {
		return maxNumber;
	}

	public void setMaxNumber(Integer maxNumber) {
		this.maxNumber = maxNumber;
	}

	public Integer getMinNumber() {
		return minNumber;
	}

	public void setMinNumber(Integer minNumber) {
		this.minNumber = minNumber;
	}

	public Integer getSubmitInterval() {
		return submitInterval;
	}

	public void setSubmitInterval(Integer submitInterval) {
		this.submitInterval = submitInterval;
	}

	@Length(min=0, max=32, message="接口文档长度必须介于 0 和 32 之间")
	public String getInterfaceDoc() {
		return interfaceDoc;
	}

	public void setInterfaceDoc(String interfaceDoc) {
		this.interfaceDoc = interfaceDoc;
	}

	public Integer getBalance() {
		return balance;
	}

	public void setBalance(Integer balance) {
		this.balance = balance;
	}

	public Integer getSpeed() {
		return speed;
	}

	public void setSpeed(Integer speed) {
		this.speed = speed;
	}

	@Length(min=0, max=32, message="商务长度必须介于 0 和 32 之间")
	public String getBusiness() {
		return business;
	}

	public void setBusiness(String business) {
		this.business = business;
	}

	public Integer getDosage() {
		return dosage;
	}

	public void setDosage(Integer dosage) {
		this.dosage = dosage;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	@Length(min=0, max=32, message="直连长度必须介于 0 和 32 之间")
	public String getDirectConnect() {
		return directConnect;
	}

	public void setDirectConnect(String directConnect) {
		this.directConnect = directConnect;
	}

	//重写toString方法
	public String toString(){
		return gwCode + gwName+maxWordNum+gwLongsms+minNumber+price;
	}

	public String getReadTimeout() {
		return readTimeout;
	}

	public void setReadTimeout(String readTimeout) {
		this.readTimeout = readTimeout;
	}

	public String getReconnectInterval() {
		return reconnectInterval;
	}

	public void setReconnectInterval(String reconnectInterval) {
		this.reconnectInterval = reconnectInterval;
	}

	public String getTransactionTimeout() {
		return transactionTimeout;
	}

	public void setTransactionTimeout(String transactionTimeout) {
		this.transactionTimeout = transactionTimeout;
	}

	public String getHeartbeatInterval() {
		return heartbeatInterval;
	}

	public void setHeartbeatInterval(String heartbeatInterval) {
		this.heartbeatInterval = heartbeatInterval;
	}

	public String getHeartbeatNoresponseout() {
		return heartbeatNoresponseout;
	}

	public void setHeartbeatNoresponseout(String heartbeatNoresponseout) {
		this.heartbeatNoresponseout = heartbeatNoresponseout;
	}
}